package com.example.module_main

import android.util.Log
import android.view.animation.Animation
import com.alibaba.android.arouter.launcher.ARouter
import com.example.common_base.ac.BaseAcKtBind
import com.example.common_base.net.RxLifecycleUtils
import com.example.module_main.databinding.ActivityMainBinding
import io.reactivex.Observable
import io.reactivex.functions.Function
import java.util.*


class MainActivity : BaseAcKtBind<ActivityMainBinding>() {
    /**
     * 0:从上往下 1:从下往上
     */
    var mTop2Bottom: Animation? = null


    override fun initSuc() {


        binding.button.setOnClickListener {
            ARouter.getInstance().build("/aaa/dev").navigation()
        }


        val aaa: MutableList<String> =
            ArrayList()
        aaa.add("asssa")
        aaa.add("asssa1")
        aaa.add("asssa2")
        aaa.add("asssa3")

        Observable.fromIterable(aaa)
            .flatMap(Function<String, Observable<Int>> {
                var aaa = it + "asdasdasd"
                val just = Observable.just(12)
                just
            })
            .`as`(RxLifecycleUtils.bindLifecycle(this))
            .subscribe {
                Log.e("tag", "onCreate: ")
            }
    }

}
